cmake_minimum_required(VERSION 3.6)
set(CMAKE_INSTALL_PREFIX ${CMAKE_SOURCE_DIR}/Linux.out)
project(mosquitto_auth_plugin)
add_definitions(-fPIC)
if (${CMAKE_BUILD_TYPE})
    if (${CMAKE_BUILD_TYPE} STREQUAL "Debug")
        add_definitions(-DBUILD_DEBUG)
    endif ()
else ()
    #默认Debug模式
    add_definitions(-DBUILD_DEBUG)
endif ()

set(MOSQUITTO_SRC ${CMAKE_CURRENT_SOURCE_DIR}/3rd_libs/mosquitto-1.6.12)
add_subdirectory(${MOSQUITTO_SRC} mosquitto_src)
include_directories(${MOSQUITTO_SRC})
include_directories(${MOSQUITTO_SRC}/lib)
include_directories(${MOSQUITTO_SRC}/src)
add_subdirectory(mqtt_plugin)